/* libcodec.h */

/***********************/
/* CODEC-DLL FUNCTIONS */
/* for Secure Phone    */
/* (C) 2002 by NAH6    */
/***********************/

#ifndef __LIBCODEC_H
#define __LIBCODEC_H
#ifndef EXPORT
#ifdef __cplusplus
#define EXPORT extern "C" __declspec (dllexport)
#else
#define EXPORT __declspec (dllexport)
#endif
#endif

/*------------*/
/*  INCLUDES  */
/*------------*/

#include <windows.h>

/*-----------*/
/*  DEFINES  */
/*-----------*/

#define E_LIBCODEC_NULLPTR  (-0x4201)
#define E_LIBCODEC_CODEC    (-0x4202)
#define E_LIBCODEC_INUSE    (-0x4203)

/*====*/

#define K_LIBCODEC_MAGIC    (0x36D9C4EAL)

/*--------------*/
/*  STRUCTURES  */
/*--------------*/

struct codec_info
{
  unsigned long  magic;
  unsigned char  ifver;
  unsigned char  ifrev;
  unsigned short ifopt;
  unsigned char  enc_mask[32];
  unsigned char  dec_mask[32];
  void          *code;
};

/*--------------*/
/*  PROTOTYPES  */
/*--------------*/

EXPORT signed short CALLBACK codec_getinfo (struct codec_info *info);
EXPORT signed short CALLBACK codec_getrev  (unsigned char codec);

EXPORT signed short CALLBACK codec_enc_create  (unsigned char codec, \
                                                void **state);
EXPORT signed short CALLBACK codec_enc_destroy (unsigned char codec, \
                                                void *state);
EXPORT signed short CALLBACK codec_enc_data    (unsigned char codec,       \
                                                void *state,               \
                                                const signed short *audio, \
                                                unsigned char *data,       \
                                                unsigned long *alen,       \
                                                unsigned long *dlen);

EXPORT signed short CALLBACK codec_dec_create  (unsigned char codec, \
                                                void **state);
EXPORT signed short CALLBACK codec_dec_destroy (unsigned char codec, \
                                                void *state);
EXPORT signed short CALLBACK codec_dec_data    (unsigned char codec,       \
                                                void *state,               \
                                                const unsigned char *data, \
                                                signed short *audio,       \
                                                unsigned long *dlen,       \
                                                unsigned long *alen);

#endif


/*** EOF ***/
